package com.twu.biblioteca;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * User: anubhav
 * Date: 1/3/14
 * Time: 7:39 PM
 * To change this template use File | Settings | File Templates.
 */
public class InputSeeker {

    public int takeIntInput() {
        Scanner in = new Scanner(System.in);
        int choice = 0;
        try {
            choice = in.nextInt();


        } catch (InputMismatchException ex) {
            System.out.println("Wrong input.Please enter a number");
            takeIntInput();
        }

        return choice;
    }

    public String takeStringInput() {
        Scanner in = new Scanner(System.in);
        return in.nextLine();

    }
}
